package com.gupao.gupaoeduvippattern.javaBase.thread.day02;

/**
 * @author 大帅
 * @description
 * @date 2020-12-06
 */
public class Consumer implements Runnable {

    private Queue queue;

    public Consumer(Queue queue){
        this.queue = queue;
    }

    @Override
    public void run() {
        int i=1;
        while (i > 0){
            queue.getNum();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            i++;
        }
    }
}
